package com.mingqijia.gassafety.authority.api.req.privilege;

import com.mingqijia.gassafety.shared.cqrs.PageableReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Max;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 查询&请求
 * @author Damon S.
 * @version v0.2
 * @date 2021-06-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "查询权限请求")
public class QueryPrivilegeReqDTO extends PageableReq implements Serializable {

    @ApiModelProperty(value = "权限主体ID", required = true)
    @Pattern(regexp = "^[\\w]{12,32}$", message = "ID格式不合法")
    private String subjectId;

    @ApiModelProperty(value = "状态：1-激活，0-冻结")
    @Max(value = 1, message = "状态值不合法")
    private Integer state;

    @ApiModelProperty(value = "权限主体类型：1角色，2用户", required = true)
    @Max(value = 2, message = "主体类型值不合法")
    private Integer subjectType;

    @ApiModelProperty(value = "权限对象类型：1菜单，2数据", required = true)
    @Max(value = 2, message = "对象类型值不合法")
    private Integer privilegeType;
}
